package com.xnfh.common.provider

import android.content.Context
import com.alibaba.android.arouter.facade.annotation.Autowired
import com.alibaba.android.arouter.launcher.ARouter
import com.xnfh.common.constant.ArouterPath
import com.xnfh.common.service.IHomeService

/**
 * @Description:
 * @Author: ziheng
 * @CreateDate: 2023/11/8 10:45
 * @UpdateUser: ziheng
 * @UpdateDate: 2023/11/8 10:45
 * @UpdateRemark: 更新说明
 */
object HomeServiceProvider {

    @Autowired(name = ArouterPath.SERVICE.HOME_SERVICE)
    lateinit var mainService: IHomeService

    init {
        ARouter.getInstance().inject(this)
    }

    /**
     * 跳转主页
     * @param context
     * @param index tab位置
     */
    fun toMain(context: Context, index: Int = 0) {
        mainService.toMain(context, index)
    }

}